package com.seven.Bean;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author seven
 * @Date 2020/4/24 9:30
 * 添加配置类后要重启生效
 * @Component：注入到容器
 * @ConfigurationProperties：映射配置
 *  prefix：映射的配置前缀
 **/


//@Component
//有 value 没有 ConfigurationProperties
//@ConfigurationProperties(prefix = "person")
@Data
public class PersonBack {
    @Value("李四")
    private String userName;
    @Value("${person.password}")
    private String password;
    @Value("${person.age}")
    private Integer age;
    @Value("${person.birthday}")
    private Date birthday;

    private Map<String,Object> map;
    private List<Object> list;
    private Dog dog;
}
